package com.mxdx.edu.common;

import com.mxdx.edu.common.log.AppLogger;


/**
 * 业务异常类
 * 
 * @author guoxc
 * @date 2015-4-21 下午4:51:07
 */
public class AppException extends RuntimeException {

    private static final long serialVersionUID = 1L;
    /**
     * 错误编码
     */
    private final String errorCode;
    /**
     * 错误信息
     */
    private String msg;
    /**
     * 打印日志所用的对象
     */
    private AppLogger appLogger;

    public AppException(Throwable cause, String errorCode, String msg) {
        super(cause);
        this.errorCode = errorCode;
        this.msg = msg;
    }

    public AppException(String errorCode) {
        super(errorCode);
        this.errorCode = errorCode;
    }

    public AppException(String errorCode, String msg) {
        super(errorCode);
        this.errorCode = errorCode;
        this.msg = msg;
    }

    public AppException(String errorCode, String msg, AppLogger appLogger) {
        super(errorCode);
        this.errorCode = errorCode;
        this.msg = msg;
        this.appLogger = appLogger;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getMsg() {
        return msg;
    }

    public AppLogger getAppLogger() {
        return appLogger;
    }

    public void setAppLogger(AppLogger appLogger) {
        this.appLogger = appLogger;
    }



}
